Audio Sample Playback Unit

ABSTRACT

Disclosed herein are a number of example embodiments for an improved audio sample playback unit. For example, multi-dimensional mapping of triggers to audio samples is disclosed. Also disclosed is low latency retrieval and playback of audio samples via pre-loading of sample heads into high speed memory. Furthermore, disclosed herein is a multi-threaded control operation for generating audio frames in response to trigger inputs, as well as the use of multiple pipes from which audio data can be generated. Further still, an example embodiment provides for multi-level control of audio properties, including voice-specific controls, pipe-specific controls, and global controls.

CROSS-REFERENCE AND PRIORITY CLAIM TO RELATED PATENT APPLICATION

This patent application is a continuation of PCT patent applicationPCT/US2019/014190, filed Jan. 18, 2019, and entitled “Audio SamplePlayback Unit”, which claims priority to U.S. provisional patentapplication Ser. No. 62/620,556, filed Jan. 23, 2018, and entitled“Improved Audio Sample Playback Unit”, the entire disclosures of each ofwhich are incorporated herein by reference.

INTRODUCTION

The inventors believe that there is a need in the art for improvementswith respect to audio sample playback units such as synthesizedelectronic musical instruments so that they are better able to closelyreplicate “analog” musical instruments. The inventors believe thatshortcomings exist in the art with respect to a number of technicalareas, including but not limited to (1) the latency by which samples areplayed in response to inputs that trigger such samples, (2) flexibilitywith respect to replicating a wide array of sounds and instruments, and(3) producing sonically diverse and rich sounds in response to inputtriggers. In this context, the term “latency” refers to the period oftime that an apparatus needs to process an audio signal in order toproduce an audible output. If the latency is too high, a user willnotice an undesirable lag between any input (e.g., recording a guitarsignal, playing a software instrument via a MIDI keyboard, etc.) and therespective output (e.g., monitoring the recording in real-time,listening to the output of the software-based instrument). If theapparatus is not able to provide the amount of processing power orappropriately engineered design that is needed to complete all audiocalculations sufficiently fast, there will be glitches in the audioplayback.

Toward these ends, the inventors disclose a number of exampleembodiments of improved audio sample playback units.

For example, the inventors disclose an audio sample playback apparatuscomprising: (1) a memory configured to store (i) a plurality of audiosamples, and (ii) a mapping data structure for the audio samples, themapping data structure configured to associate the audio samples with atleast one trigger parameter, and (2) a processor configured to (i)receive trigger inputs, and (ii) for each of a plurality of the receivedtrigger inputs, (a) determine at least one trigger parameter from thereceived trigger input, (b) access the mapping data structure toidentify a triggered audio sample associated with the determined atleast one trigger parameter, (c) retrieve the identified triggered audiosample from the memory, and (d) generate an audio frame based on theretrieved triggered audio sample. The mapping data structure maycomprise a multi-dimensional array that associates the audio sampleswith a plurality of trigger parameters (such as trigger position,trigger velocity, round robin position, or other trigger parameters) toefficiently locate the appropriate audio samples for playback whileproviding a rich set of sounds for the apparatus.

As another example, the inventors disclose an audio sample playbackapparatus comprising: (1) a first memory configured to store a pluralityof heads for a plurality of audio samples, (2) a second memoryconfigured to store a plurality of tails for a plurality of the audiosamples, and (3) a processor configured to, in response to an audiosample being triggered, retrieve the head for the triggered audio samplefrom the first memory and begin playback of the retrieved head prior toretrieval and playback of the tail for the triggered audio sample fromthe second memory. The first memory can be a high speed memory such asRAM, while the second memory can be a low speed memory such as a disk.By permitting the processor to retrieve and begin playback of audiosample heads from the high speed memory while retrieving the audiosample tails from the low speed memory, the apparatus is able togenerate audio at reduced latency because head playback can beginquickly while tail retrieval is performed in the background.

As yet another example, the inventors disclose an audio sample playbackapparatus comprising: (1) a memory configured to store a plurality ofaudio samples, and (2) a processor configured to (i) retrieve audiosamples from the memory in response to triggers, (ii) assign triggeredaudio samples to a plurality of pipes, and (iii) generate audio framesfrom the pipes based on the retrieved audio samples, wherein each pipehas independently adjustable control settings for audio properties to beapplied to audio samples within the pipes. In this context, each piperefers to a pipeline of execution (among multiple pipelines ofexecution). The processor can further be configured to (1) assigntriggered audio samples to a plurality of voices, and (2) assign thevoices to the pipes, wherein each voice has independently adjustablecontrol settings for audio properties to be applied to audio samplesassigned to the voices. Such pipe-specific and voice-specific audiocontrols provide users with deeply granular control over everyindividual note played, which further enhances the depth of sound thatthe apparatus can produce.

Still further, as another example, the inventors disclose an audiosample playback apparatus comprising: (1) a memory configured to store aplurality of audio samples, and (2) a processor configured toconcurrently execute a plurality of threads to generate audio frames inresponse to triggers, wherein the threads include (1) a first thread forassigning triggered audio samples to voices, (2) a second thread formixing audio from a plurality of active voices, (3) a third thread forretrieving at least portions of the triggered audio samples from thememory, and (4) a fourth thread for framing the mixed audio. Thedistribution of tasks across these multiple threads also reduces latencyfor audio sample playback in response to trigger events.

Various corresponding methods and computer program products are alsodisclosed herein.

Through these and other features, example embodiments of the inventionprovide significant technical advances in the art by harnessing computertechnology to improve how sound is electronically produced from audiosamples stored in computer memory.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 discloses an example audio sample playback unit in accordancewith an example embodiment.

FIGS. 2A and 2B show examples of how audio samples can be mapped totrigger parameters.

FIG. 3 depicts an example process flow for an example embodiment of anaudio sample playback unit.

FIG. 4A shows an example of how sample head data can be pre-loaded fromlow speed memory such as a disk into high speed memory such as RAM toreduce playback latency.

FIG. 4B depicts another example process flow for an example embodimentof an audio sample playback unit that uses the sample headingpre-loading technique of FIG. 4A.

FIG. 5 shows an example embodiment of a multi-threaded control processfor an example embodiment of an audio sample playback unit.

FIG. 6A depicts an example process flow for the main thread of FIG. 5.

FIG. 6B depicts an example of how voices can be linked in a pipe.

FIG. 7 depicts an example process flow for the mixer thread of FIG. 5.

FIG. 8 depicts an example process flow for the disk thread of FIG. 5.

FIG. 9 depicts an example process flow for the jack process thread ofFIG. 5.

FIG. 10A depicts an example operational pathway for an exampleembodiment of an audio sample playback unit.

FIG. 10B discloses an example audio sample playback unit in accordancewith another example embodiment.

FIG. 11 discloses an example sound mixing arrangement with respect to anexample set of voices and pipes.

FIGS. 12A-C disclose example visualizations of how audio samples can bemapped to multiple dimensions.

FIG. 13 discloses an example hardware arrangement for an example audiosample playback unit.

FIG. 14 discloses an example voice structure.

FIG. 15 discloses example dispatcher code for a dispatcher thread.

FIG. 16 discloses an example pipe structure.

DETAILED DESCRIPTION OF EXAMPLE EMBODIMENTS:

FIG. 1 discloses an example audio sample playback unit 100. The audiosample playback unit 100 can take the form of a synthesized electronicmusical instrument; for example, an electronic drum, an electronickeyboard (piano, organ, etc.), and the like. The audio sample playbackunit 100 generates audio output in response to user input, and the audiosample unit 100 may comprise an input interface 102, processor 104,memory 106, and sound card 108. The components of the audio sample unit100 can be enclosed in a housing with any of a number of form factors.For example, the housing can be shaped to replicate a musical instrumentsuch as a drum, keyboard, etc. However, it should also be understoodthat the housing need not be shaped to replicate a musicalinstrument—for example, the components could be housed more generally ina computer system (e.g., laptop computer, tablet computer, desktopcomputer) or sound board.

The input interface 102 translates user inputs 110 into input triggers112. The input interface can take any of a number forms. For example,the input interface 102 can include a user interface (UI) through whichuser inputs 110 are received. Such a UI can be a graphical UI (GUI),such as a GUI touchscreen. For example, a GUI touchscreen can visuallydepict a keyboard, and the input interface 102 can detect the locationsof user touches on the GUI touchscreen and translate those locationsinto trigger inputs 112 reflective of the key strike locations (or notescorresponding to those key strike locations). As another example, the UIcan be designed to receive drum strikes (such as from a drumstick orhand), and the input interface 102 can detect the locations of drumstrikes for use as trigger inputs 112. However, it should also beunderstood that the input interface 102 can connect with peripheraldevices such as a musical controller that provides user inputs 110 inthe form of electronic signals representative of note or soundselections.

Processor 104 and memory 106 cooperate to generate audio frames 114 fromthe trigger inputs 112. The processor 104 may comprise one or moreprocessors such as general-purpose processors (e.g., a single-core ormulti-core microprocessor), special-purpose processors (e.g., anapplication-specific integrated circuit or digital-signal processor),programmable-logic devices (e.g., a field programmable gate array), etc.that are suitable for carrying out the operations described herein. Inan example embodiment, it is preferred that the processor 104 be capableof executing several threads simultaneously. The memory 106 may compriseone or more non-transitory computer-readable storage mediums, such asvolatile storage mediums (e.g., random access memory, registers, and/orcache) and/or non-volatile storage mediums (e.g., read-only memory, ahard-disk drive, a solid-state drive, flash memory, and/or anoptical-storage device). The memory 106 may also be integrated in wholeor in part with other components of the unit 100. Further, the memory106 may be local to the processor 104, although it should be understoodthat the memory 106 (or portions of memory 106) could be remote from theprocessor 104, in which case the processor 104 may access such remotememory through an interconnect or the like.

Memory 106 may store software programs or instructions that are executedby processor 104 during operation of the unit 100. For example, thememory 106 may store the programs for the process flows discussed below,which can take the form of a plurality of instructions configured forexecution by processor 104. The memory 106 may also store audio sampledata, which can take the form of a plurality of audio samples. Thesamples can be audio files in any of a number of audio file formats,such as .wav and .aiff. The audio sample data and files can beuncompressed audio. Each sample can correspond to a different note orsound that can be produced by the unit 100. The memory 106 may alsostore one or more mapping data structures for use by the processor 104when mapping trigger input-related data to audio samples. This mappingdata structure can allow the processor to quickly locate and access anaudio sample in response to the user input 110.

During operation, the processor 104 translates the trigger inputs 112into trigger data that gets mapped to audio samples in the memory 106via the mapping data structure, and the processor 104 then generatesaudio frames 114 from these mapped audio samples.

The sound card 108 converts the audio frames 114 into an audio outputsignal 116 that can be provided to a speaker and/or headphone so that auser can hear the sounds that are responsive to the user inputs 110. Thesound card 108 can have a corresponding driver that links the sound card108 with the processor operations. As an example, the sound card 108 cantake the form of a digital to analog converter (DAC) for audio data.

FIGS. 2A and 2B show examples of how audio samples can be mapped totrigger data. The audio samples can correspond to sounds with differentaudio characteristics. The trigger data can be represented by one ormore trigger parameters. Examples of trigger parameters can include noteor sound identifiers, characteristics of input 110 (such as input note,input velocity, modulation ‘mod’ wheel position, input duration, and thelike), etc. Velocity is a term of art that relates to the force withwhich a note is struck, which in turn can influence how loud the soundwill be. To permit the system to select an appropriate audio sample inresponse to a given input 110, the memory 106 can maintain a mappingdata structure that associates audio sample identifiers 200 with one ormore trigger parameters, as shown by the examples of FIGS. 2A and 2B.The example of FIG. 2A shows a one-dimensional mapping where each audiosample identifier 200 is associated with a value along trigger parameteraxis 202. Each audio sample identifier 200 can correspond to a differentaudio sample in the memory 106 and can be represented by data thatserves to identify the corresponding audio sample, such as a memoryaddress where the corresponding audio sample can be found. The mappingdata structure could also employ one or more layers of indirection suchas a naming convention to identify samples (for example, a multi-bytecode unique to each sample (e.g., a 16 byte code)). The triggerparameter axis 202 can be a parameter such as a note, in which case Note1 gets mapped to Sample ID 1, Note 2 gets mapped to Sample ID 2, and soon.

However, for a more robust sound arrangement, the audio samples can beassociated with multiple trigger parameters; an example of which isshown by FIG. 2B. For example, the first trigger parameter axis 212 canidentify a note number, while the second trigger parameter axis 214 canidentify an input characteristic such as an input velocity (e.g., toreplicate the variable response of a musical instrument to the beingstruck relatively harder or softer). For example, a musical instrumentdigital interface (MIDI) note number can be used as a trigger parameteraxis, as can MIDI velocity, and MIDI controller values. Thus, in anexample embodiment where the unit 100 is a synthesized electronicmusical instrument such as an electronic drum, the audio sample thatgets selected when the electronic drum is struck twice in the samelocation can vary based on how hard the electronic drum was struck atthat same location. Thus, FIG. 2B shows an example of amulti-dimensional mapping data structure for mapping audio samples tomultiple trigger parameters in order to yield a unit 100 that canproduce richer sound in response to inputs 110. Moreover, while theexample of FIG. 2B shows a two-dimensional mapping data structure, itshould be understood that additional dimensions can be provided byfurther associating the audio samples with additional triggerparameters.

Also, while FIGS. 2A and 2B show plots of audio sample identifiersacross trigger parameter dimensions for ease of illustration, it shouldbe understood that the mapping data structure can take any of a numberof forms. For example, the mapping data structure can take the form ofone or more data structures in memory 106 such as lookup tables, linkedlists, relational database tables, hashing tables, etc.

FIG. 3 depicts an example process flow for an audio sample playback unit100. If user input 110 is received at step 300, the process flowproceeds to step 302. At step 302, the user input 110 is translated intotrigger data. As mentioned above, the user input 110 may take the formof a “touch” at a particular location on a touchscreen user interface,and the input interface 102 may produce a trigger input 112 thatreflects this input location. The processor 104 can then determine amusical note or sound that corresponds to this input location. Suchtranslation can be performed based on a mapping of input locations onthe touchscreen user interface to identifiers for notes or sounds.However, it should be understood that the input interface 102 could alsobe configured to detect additional characteristics of the user input110, such as an input velocity, input duration, etc. Such detection ofadditional characteristics can be performed by way of a UI-programmedinterpretation of incoming data such as MIDI data or it can be done byway of a UI circuit and UI programming that detects varying voltagelevels coming from analog equipment such as an analog modularsynthesizer control voltage and trigger voltage outputs. Accordingly, itshould be understood that the trigger input 112 can also include datathat reflects such additional input characteristics. If the user input110 takes the form of an input file provided to unit 100 from a musiccontroller or the like, then step 302 can operate to translate thesequence of note entries in the input file into a sequence of triggerdata. The trigger data produced at step 302 can identify an identifierfor a note (e.g., a musical note), and it may also identify additionalinformation such as velocity, duration, etc. Examples of scenarios wherethe trigger data includes additional information are described below.

At step 304, the processor 104 maps the trigger data to an audio samplein the memory 106. The mapping data structure(s) maintained in memory106 can assist the processor in this regard by associating audio sampleswith parameters of trigger data. Thus, the processor 104 can map one ormore trigger data values to an audio sample identifier 200 as shown byFIGS. 2A and 2B.

At step 306, the processor 104 reads the mapped audio sample from memory106. The sample identifier 200 determined at step 304 can assist theprocessor 104 in this regard. For example, the sample identifier 200 canidentify the memory address where the relevant audio sample is located.

At step 308, the processor 104 processes the audio sample read at step306, and generates an audio frame 114 in response to this processing. Itshould be understood that the audio sample identifiers 200 can also beassociated with additional metadata that defines a variety of controlsettings for controlling the playback of the subject audio sample.Examples can include control variables for audio parameters such aspitch, volume, pan, etc. Pan is a measure of how much of an audio signalis sent to the left or right side of the full audio field. A hard panleft can result in only sound from a left speaker, while a hard panright can result in only sound from a right speaker, and a center pancan result in an equal amount of signal to the left and right sides. Theprocessor 104 can use this associated metadata to control how the audiosample is rendered into an audio frame 114 based on such audioparameters. Also, as explained below, step 308 may also include a mixingoperation where a new audio sample is mixed in with other audio samplesthat are currently being played.

At step 310, the processor 104 provides the audio frame 114 to soundcard 108. This can be achieved by passing the audio frame 114 to adriver for the sound card 108. Thereafter, at step 312, the sound card108 converts the audio frame 114 into an audio output signal 116 thatcan be heard via one or more speakers and/or headphones.

As mentioned above, improvements to playback latency while maintaining arich sound is something for which the inventors believe there is a needin the art. To provide a diverse base of potential sounds for the unit100, the size of the audio sample data in memory 106 is expected to belarge, and the unit 100 will need to be able to quickly respond to auser input 110 to locate and playback an audio sample each time the unit100 is triggered with new user inputs 110. This poses a technicalproblem for system designers; and as a solution to this technicalproblem, the inventors disclose an example embodiment where portions ofaudio samples are stored in high speed memory for faster access by theprocessor 104. FIG. 4A shows an example of such an embodiment where thehead portions of audio samples are stored in a high speed memory such asa random access memory (RAM) from which the processor 104 can read atlow latency. The head portion of an audio samples can be the beginningportion of the sample (e.g., the first 65 KB of the sample). Theremainder of the sample (the tail portion) would remain in low speedmemory (such as a disk), and the processor 106 would access the tailportion of the sample while playback of the head portion may havealready begun. It should be understood that the head portion could be aportion that is longer or shorter than the first 65 KB of the sample. Afactor that a practitioner can use when choosing how large to make thehead portion is how long the system will take to identify theappropriate tail to retrieve from low speed memory and then beginning toretrieve and mix the identified tail from the low speed memory. Thus,when selecting how large to make the head portion, a tradeoff ariseswhere (1) including too much sample in the head portion can lead towasted time and higher latency from trigger to initial audio output, but(2) including too little sample in the head portion can cause underrunsbecause the tail may not be ready for audio output when the end of thehead portion playback is reached (which may cause undesirable audibledigital clicking). The inventors believe that, for an exampleembodiment, the size of the head portion can be any value in a rangefrom around the first 20 KB of a sample to around the first 120 KB ofthe sample.

In FIG. 4A, the low speed memory is shown by way of example as a disk onwhich audio samples in the form of various sample files are stored atvarious memory addresses. Each sample file can include a head portionand a tail portion. A sample manager program executed by the processor104 can be configured to fill the high speed memory (shown in theexample of FIG. 4A as RAM) with the head portions of each sample file.Thus, the head portions of audio samples are accessible to processor 104at a lower latency than the tail portions of the audio samples, and theplayback process can start playing audio sample heads from the highspeed memory while still retrieving and processing the sample tails fromlow speed memory.

FIG. 4B shows an example process flow for audio sample playback wheresample heads are pre-loaded into high speed memory. After start up (step450), the sample manager executed by processor 104 loads the sample fileheads into RAM from disk at step 452 (and associates the sample fileheads with sample identifiers or the like that allow for fast look up ofsample file heads when needed). As an example, the sample manager canknow the memory address of each sample file on the disk by way of alibrary for reading and writing sample files, for example the widelyused C library called libsndfile. For each such memory address, thesample file head is loaded into RAM. At step 452, the sample manager canalso check the files in the sound file library on the disk to see if allfiles are valid sound files, check file sizes (in case a sample's fulllength is shorter than an expected for a standard head size), andallocate buffer space in RAM for each sample file in the library.Thereafter, steps 300-304 can proceed as described above in connectionwith FIG. 3.

Steps 306-310 from FIG. 3 would then be performed in a manner whereaudio sample heads are read from the high speed memory (e.g., from astatic buffer in the high speed memory) while the audio sample tails areread from the low speed memory. These tails can then be written into thehigh speed memory, such as in a separate and temporary buffer in thehigh speed memory. Thus, after the trigger data has been mapped to audiosample at step 304, the process flow can (1) read the sample head forthe mapped audio sample from the high speed memory (see step 454), (2)process the read audio sample head to generate the head portion of anaudio frame (see step 456), and (3) provide the head portion of theaudio frame to the sound card (see step 458). While steps 454-458 arebeing performed, the processor 104 can also (1) read the tail for themapped audio sample from the low speed memory into the high speed memory(see step 460), (2) process the read audio sample tail to generate thetail portion of an audio frame (see step 462), and (3) provide the tailportion of the audio frame to the sound card (see step 464). The soundcard would then convert audio frames 114 into audio sound output 116 asdiscussed above. In this way, the unit 100 can quickly begin playback ofthe head portions of audio samples while using the available additionaltime to access and playback the tail portions of audio samples.

While the example of FIG. 4A shows an example where memory 106 includesa low speed memory in the form of a disk and a high speed memory in theform of RAM, it should be understood that other types of low and highspeed memory could be employed. For example, flash memory could be usedas the low speed memory rather than disk memory The memory speeds can bereflective of the relative speeds by which a processor can read datafrom such memories. It is generally expected that a non-volatile memoryexternal to processor 104 such as a disk or other physical memory device(e.g., a USB memory stick) will be slower with respect to data reads bya processor than a volatile memory internal to processor 104.

The inventors also disclose that playback latency can be improvedthrough the use of threading where various playback tasks can bedistributed among different processing threads that are executedconcurrently by one or more processors capable of multi-threadedoperation. An example of a multi-threaded approach to sample playback isshown by FIG. 5.

Moreover, to further improve playback latency while retaining richsound, the inventors also disclose an example embodiment where the unit100 processes samples into multiple pipes from which audio can beconcurrently produced. In example embodiments, each pipe can have itsown independently configured audio controls, which further enhances therobustness of the produced sound, particularly when the samplesthemselves have their own controllable audio control settings.

FIG. 5 shows how the unit 100 can employ multiple threads to processaudio samples through multiple pipes in response to user input. Theprocessor 104 can execute threads 502, 504, 506, and 508 concurrently.Thread 502 can be referred to as a main thread. Thread 504 can bereferred to as a mixer thread. Thread 506 can be referred to as a diskthread. Thread 508 can be referred to as a jack process thread.Interconnecting various ones of these threads are buffers. These bufferscan be ring buffers. These buffers can also be single-producer,single-consumer; meaning that one thread writes to them and anotherthread reads from them. For example, a dispatch ring buffer 510 canconnect the main thread 502 with the mixer thread 504, a disk ringbuffer 512 can connect the mixer thread 504 with the disk thread 506, atail ring buffer 516 can connect the disk thread 506 back to the mixerthread 504, and a jack ring buffer 514 can connect the mixer thread 504with the jack process thread 508.

The main thread 502 receives commands to trigger new voices and managesthe other threads. In an example embodiment, main thread 502 operates todispatch voices 520 to the dispatch ring buffer 510 in response totrigger data 500. In this example, the trigger data 500 can comprise (1)an identifier for the audio sample to be triggered (e.g., a sample filenumber), (2) a pipe number signifying the pipe to which the triggeredsample has been assigned, (3) the pitch at which the triggered sampleshould be played back, (4) the volume at which the triggered sampleshould be played back, and (5) the pan at which the triggered sampleshould be played back. A voice 520 is an audio object which containsdata about a triggered sample. The unit 520 can maintain a definednumber of voices 520 that can be populated with triggered samples asdiscussed below.

FIG. 6A depicts an example process flow for main thread 502. At step600, the main thread initializes the voices 520 with empty data forsample heads and tails. These dummy voices 520 do not yet contain anyaudio data. At step 602, the main thread checks whether trigger data hasbeen received. If so, at step 604 the main thread selects an availablevoice from a dead pool array, which can be an array of flags indicatingwhether a given voice is available for triggering. The unit can maintaintwo queues of voices 520—(1) an active queue that is filled with voices520 that have been populated with audio data and for active processingby the unit 100, and (optionally) (2) a dead pool queue that is filledwith empty voices 520 that are available for population. As mentioned,step 604 selects an available voice 520 from the dead pool array, but aqueue structure could be used instead if desired by a practitioner. Atstep 606, the main thread populates the selected voice 520 withvariables based on the sample defined by the received trigger data.Thus, the selected voice 520 can be populated with (1) a sampleidentifier for the triggered sample, (2) a pipe number to which theselected voice 520 will be assigned, (3) the pitch at which thetriggered sample should be played back, (4) the volume at which thetriggered sample should be played back, and (5) the pan at which thetriggered sample should be played back. At step 608, the populated voiceis written to the dispatch ring buffer 510, and the process flow returnsto step 602.

Thus, it should be understood that as a result of the execution of themain thread 502, the dispatch ring buffer will be populated with voices520, where each voice 520 is populated with information about an audiosample to be played.

Voices 520 can be chained together in a sequential order to define apipe, where the pipe is a linkage of one voice 520 to the next voice 520in a sequence. FIG. 6B shows an example pipe 650 (among N pipessupported by the unit 100). As new trigger data 500 comes in, a voice520 is populated with data about the triggered sample, and each voice520 can also identify a next voice and a parent voice to define thesequential order of voices for the subject pipe. The pipes 650 supportedby the unit are thus filled with voices 520 that are linked together ina defined order, and these pipes 650 serve as an audio route tree forthe unit 100. The audio route tree defines an arrangement of orderedaudio samples to be played by the unit.

The mixer thread 504 operates to read voice data from the dispatch ringbuffer 510, access samples in memory 106, and mix together active audiodata for subsequent output. In effect, it evaluates the audio routetree, pulls audio samples from active voices for each pipe, applieseffects and mixes audio together. The mixer thread 504 can also read newactive voices from the dispatch ring buffer 510 and discard inactivevoices into the dead pool queue. FIG. 7 depicts an example process flowfor the mixer thread.

At step 700, the mixer thread reads a voice 520 from the dispatch ringbuffer. The mixer thread then builds a pipe based on the read voice 520(step 702). Voices 520 can be read from the dispatch ring buffer on afirst in first out (FIFO) basis. Also, steps 700 and 702 can iterativelyrepeat as new voices 520 become available in the dispatch ring buffer510. As voices are added to a pipe, the current voice is associated witha pointer to the previous voice in that pipe, and the previous voice inthat pipe is associated with a pointer to the current voice in that pipe(as in a doubly-linked list). This produces pipes in the form of one ormore chains of incoming voices.

At step 704, the mixer thread selects a pipe. The pipe selection canproceed in an incremental fashion where the mixer thread starts at pipe1 and progresses through pipe N in a round robin fashion.

At step 706, the mixer thread selects a voice in the selected pipe. Thevoice selection can also proceed in an incremental fashion where themixer thread starts with the oldest voice 520 in the pipe and progressesthrough newer voices 520 according to the defined sequence of theselected pipe (see FIG. 6B).

Once the voice 520 has been selected at step 706, the mixer thread canstart retrieving the head and tail for the sample corresponding to theselected voice from the high speed memory. These operations can leveragethe high speed memory and low speed memory as discussed above.

At step 708, the mixer thread retrieves the relevant sample head fromRAM for the selected voice 520. This retrieval can look up the samplehead based on the sample identifier included in the selected voice. Atstep 710, the mixer thread processes/renders the retrieved sample headusing the settings for the selected voice 520 and the selected pipe tocontrol audio characteristics of the sample playback. If both the voiceand pipe have associated settings, step 710 can sum these settings toproduce the resultant data. If there are limits associated with asubject setting, and the sum either exceeds an upper limit or fallsbelow a lower limit, the corresponding upper limit or lower limit valuecould be used. At this point, the audio for the processed sample headcan be mixed together with any other active audio that is being playedby the unit 100 at that time to produce augmented audio data. It shouldbe understood that each sample will have a certain duration, and not allsamples may share the same duration. Thus, when a new sample istriggered, the unit 100 may still be playing back a residual portion ofa previous sample when starting playback of the new sample. Accordingly,step 710 may include adding the audio for the new sample to the existingaudio to be played back. Separate buffers can store portions of allaudio samples that are active at a given time and from which theresultant audio will be mixed. At step 712, the mixer thread writes theaugmented audio data for the head portion of the triggered sample to thejack ring buffer 514.

While steps 708-712 are being performed, the mixer thread can alsoperform steps 716-722 to process the sample tail. At step 716, the mixerthread writes data about the selected voice 520 to the disk ring buffer512 (e.g., writing the sample identifier to the disk ring buffer 512).At this point, the mixer thread will wait for the disk thread 506 toreturn the tail for the subject sample. Once such tail is available inthe disk ring buffer 512, the mixer thread will read the sample tail forthe selected voice from the disk ring buffer 512 (step 718). Then, atstep 720, the mixer thread processes/renders the retrieved sample tailusing the settings for the selected voice 520 and the selected pipe tocontrol audio characteristics of the sample playback. This step 720 canperform mixing as discussed above for step 710 except with respect tothe audio tail rather than the audio head. At step 722, the mixer threadwrites the augmented audio data for the tail portion of the triggeredsample to the jack ring buffer 514. As discussed above, it is expectedthat the path for steps 716-722 will take longer to complete than pathfor steps 708-712, so by pre-positioning the sample heads in high speedmemory, the unit 100 is able to perform sample playback at lower latencythan would be the case if no sample head pre-positioning were employed.

If the processor 104 has completed the processing of the sample headprior to the tail becoming available for processing, the processor canreport an underrun error and an audible digital clicking will likelyresult. Alternatively, the processor may repeat/loop the sample head atsteps 710 and 712 until such time as the tail becomes available.

At step 724, the mixer thread discards the selected voice to the deadpool queue to make it available to the main thread 502 for a newlytriggered sample. Then, at step 726, the mixer thread checks whetherthere is another voice in the selected pipe. If so, the mixer threadreturns to step 706 and selects the next voice 520 in the selected pipe.If not, the mixer thread proceeds to step 728. At step 728, the mixerthread checks whether there is another pipe with an active voice. If so,the mixer thread returns to step 704 and selects the next pipe with anactive voice. If not, the mixer thread awaits a new pipe from steps700-702.

The disk thread 506 operates to retrieve tails from the disk thatcorrespond to the triggered samples of the voices 520 in the disk ringbuffer 512. These retrieved tails are then passed back to the mixerthread 504. FIG. 8 depicts an example process flow for the disk thread506. At step 800, the disk thread reads voice data from the disk ringbuffer 512. This voice data can include a sample identifier. The diskthread 506 can read voice data from the disk ring buffer on a FIFObasis. At step 802, the disk thread 506 retrieves the sample tailcorresponding to the read voice data from the disk. This retrieved tailis then written to the tail ring buffer 516 and read by the mixer thread(see step 718 from FIG. 7). It should be understood that in analternative embodiment, a practitioner may choose to combine the diskring buffer 512 and tail ring buffer 516 as a single buffer for holdingincoming voice data and outgoing tails.

The jack process thread 508 operates to create audio frames 114 from thesummed/mixed audio data in the jack ring buffer 514. FIG. 9 depicts anexample process flow for the jack process thread 508. At step 900, thejack process thread receives an audio request from an audio servercontext. At step 902, the jack process thread reads audio data from thejack ring buffer, frames it, and provides the audio frame 114 to adriver for the sound card 108.

Through the main thread 502, mixer thread 504, disk thread 506, and jackprocess thread 508, the processor 104 is able to quickly navigate anaudio route tree of samples, stream those audio samples through a mixingprocess, and robustly produce audio that is responsive to user input.

Also, the inventors note that to provide stereo sound, each audio samplecan have a left sample and a right sample, and the operations describedherein can be performed for both the left and right samples.

In another example embodiment, the unit 100 can provide for enhancedcontrol over audio sample playback via adjustable controls, which can bereferred to as “tweakers”. FIG. 10A depicts an example operationalpathway for a unit 100 that permits users to selectively tweak the audiocharacteristics of the audio output. The triggered samples are runthrough a set of tweakers that controllably adjust and condition theaudio samples to create the digital audio files that have audio effectsapplied to them for the creation of the audio output. FIG. 10B depictsan example embodiment of such a unit 100 where a control interface 1010interfaces the processor 104 with various control inputs to definecontrol settings for voices and/or pipes. The control interface 1010 cantake the form of user interface such as dials, knobs, buttons, switches,and/or virtual controls presented on a GUI such as a touchscreen GUI.Through the control interface 1010, control inputs regarding audiosettings such as pitch, pan, etc. can be received. If the unit 100supports different libraries of sounds files for different instruments(e.g., a set of sound files for replicating Drum Type A, a set of soundfiles for replicating Drum Type B, a set of sound files for replicatingKeyboard Type C, etc.), the control input can also define an instrumentmode for the unit 100 by selecting one of the sound libraries for use asthe source of audio samples. Through the control interface 1010, eachpipe and/or voice can have individually-controlled audio properties,such as volume, pan, pitch, tweakers, and other audio effects.

A subset of these adjustable controls can define input signalconditioning for various different existing musical controllers so thatsuch musical controllers can be easily connected with the unit 100 forseamless operation. Such a subset of adjustable controls can be referredto as “conditioners”. Thus, the control inputs can also be instructionsfrom peripherals such as musical controllers to condition the audiosounds produced by the unit.

FIG. 11 discloses an example sound mixing arrangement with respect to anexample set of voices and pipes, where this sound mixing arrangement canbe controlled in part based on the control inputs received via thecontrol interface 1010 of FIG. 10B. The sound mixing operations of FIG.11 can be performed as parts of steps 710 and 720 of FIG. 7. In thisexample, the unit supports 4 pipes, where pipe 1 supports 4 linkedvoices. However, it should be understood that more or fewer voices couldbe supported if desired by a practitioner (e.g., see voice n). Eachvoice can have its audio data controlled with the voice-specific controlsettings for characteristics such as pitch, volume, and pan (via thepopulated control variables for the voices 520). In the example of FIG.11, Voices 1 and 2 have a clean route in Pipe 1 where no pipe-specificeffects are applied to Voices 1 and 2. However, for Voices 3 and 4,pipe-specific effects can be applied to those voices as shown by the FXoperation in the processing pipeline for Voices 3 and 4 in FIG. 11.

FIG. 11 also shows an example where Pipes 2-4 apply audio effects to theresultant audio, but without any voices. After the audio data from eachpipe has been summed together via a mixing operation, the summed audiodata has global FX and global volume settings applied to it, where suchglobal FX and global volume settings can be controlled by a user throughthe control interface 1010.

Thus, it can be seen from FIG. 11 that the ability to independentlycontrol audio properties for both voices and pipes, as well as globalcontrols, provides users with tremendous flexibility for controlling thesonic character of audio output so that unit 100 is able to produce richsounds desired by a user.

FIGS. 12A-12C show examples of multi-dimensional mapping data structureswhere the sample metadata can include control variables to be applied tothe voices. These mapping data structures can have a digital containerfile format, and can be referred to as a multi-dimensional array (MDA)The MDA can also include the audio samples as well as the metadata forthe audio samples. As indicated above, audio samples can be mapped tovarious parameters that serve as dimensions in the MDA. In the exampleof FIGS. 12A-12C, audio samples are mapped across a “note number”dimension and a “velocity” dimension (e.g., MIDI note numbers and MIDIvelocities). To provide yet more realism, the audio samples can also bemapped across a third dimension that serves as a variability dimension,referred to as a round robin parameter. Each audio sample sharing thesame x,y dimensions can be repeated in the round robin “z” dimensionwith a slight variation of its audio properties. When selecting an audiosample for given x,y trigger values, the unit can also select a roundrobin value for the sample selection so that a repeated triggering ofthe same sample at the x,y location will not produce the exact samesound because the system will iterate or otherwise transition throughthe round robin versions of the subject sample (e.g., randomly selectinga round robin version of the sample each time the subject sample istriggered).

Each sample voxel in the array can include data about the subject audiosample, such as (1) the sample's address in memory 106, (2) a max volume(which can be realtime configurable by way of incoming MIDI data orother means such as a UI-generated low frequency oscillator (LFO) signaland others, (3) a pan (which can also be realtime configurable), (4) apitch (which can also be realtime configurable), (5) a pipe number forthe sample, (6) a reverse setting which can serve as an indicator forwhether an audio sample should be played front to back or back to front(where reverse “on” can mean that it plays back to front), (7) a oneshot setting which can serve as an indicator for whether an audio sampleshould play all the way through to completion even if its voice receivesan “off” message while it is playing, (8) a latch setting which canserve as an indicator for playing an audio sample when its trigger isreceived and stopping the playing of that sample if that trigger isreceived again before the sample is done playing, (9) a loop settingwhich can serve as an indicator for playing a sample over and over whileits trigger remains engaged, (10) a voice lock setting which canindicate whether a voice is to be killed by way of the system reachingits maximum number of concurrently sounding voices (where a voice lock“on” means that the system will find a different voice to kill if themax voice limit is reached), (11) a voice limit setting which canindicate a maximum number of voices that can sounding at the same time(which, if desired by a user, can be a value less than the systemdefault maximum number of voices), (12) an identification of the voicenumbers of any currently sounding voices assigned to this voxel,including its round robins, (13) a LoLim setting which can represent thelow note or low controller setting assigned to a sample that willtrigger that sample if it is input into the system, (14) a HiLim settingwhich can represent the high note or high controller setting assigned toa sample that will trigger that sample if it is input into the system,(15) a LoVel setting, and (16) a HiVel setting (where the LoVel andHiVel settings represent the range of velocities that a sample isassigned to within its LoLim and HiLim settings such that a sample willbe triggered at its velocity level when an appropriate signal (one thatis within the LoLim and HiLim assigned to that particular sample isinput into the system).

FIG. 12A depicts a standard mode MDA where audio sample identifiers andtheir associated parameters are placed into array voxels. The file forthis MDA is labeled as Cube A in FIG. 12A. The names and shadings on thevoxels identify each voxel's corresponding sample. In this example, itcan be seen that there are 3 samples (Beep.wav, Pop.wav, and Ding.wav),although it should be understood that much larger numbers of samplescould be used. The names and shadings show how the various samples canbe spread over a range of trigger parameters. FIG. 12B depicts astandard mode where identifiers for single tonal audio samples and theirassociated parameters are placed into array voxels. A single tonal MDAis an MDA made from samples of a tonal instrument such as a piano (asopposed to a percussive instrument such as a drum, whose samples arepercussive rather than tonal). FIG. 12C depicts a mandala drum modewhere identifiers for single percussion/drum audio samples and theirassociated parameters are placed into array voxels. In a Mandala Drummode, there can be four possible MDAs (or cubes in this example). EachMDA can include different samples to adjust the nature of percussivesounds produced by the unit.

FIG. 13 discloses an example hardware arrangement for the audio sampleplayback unit 100, although it should be understood that differenthardware arrangements could be employed. In this example, the unit'smain hardware can be deployed on two single board computers (SBCs)—oneSBC can be used for the input interface 102 and associated input datahandling, and the other SBC can be used for audio generation by theprocessor 104. In an example embodiment, code on the interface SBC canbe open source, while code on the audio SBC can be proprietary non-opensource. FIG. 13 shows an LCD touchscreen for connection with an SBCwhich, in this example, can take the form of an RasPi3 board. Theinterface between the LCD touchscreen and the RasPi3 board can be viaHDMI and USB as shown in FIG. 13. External inputs to the RasPi3 boardcan be a 5 pin MIDI input, a USB input, one or more rotary encoders, andone or more buttons. The audio SBC can be embodied by an Odroid boardthat connects with the RasPi3 board via Ethernet or UART. Externalinputs to the Odroid board can include a USB input. The Odroid board canalso include an output such as a USB to host connection as shown in FIG.13. The Odroid board can also connect to a HiFi board via I2S, andthrough the HiFi board, audio signals can be provided to headphones orspeakers via appropriate output ports.

FIG. 14 shows an example voice structure, struct voice_t, for an activevoice. Its properties such as pitch, pan, and volume can be created by asample dispatcher such as sample_dispatcher( ) shown by FIG. 15. Throughthe sample dispatcher, each voice can be assigned to a pipe, which inthis example can be one of 4 pipes. Each pipe can have a clean route andan FX route. The active effects for each pipe can be assigned using astructure such as struct_fx_list_t as shown by FIG. 16.

The inventors note that a practitioner can employ any of a number oftechniques to assign triggered samples to voices and assign voices topipes. For example, as disclosed above, the mapping data structures canassociate audio samples with specific pipes. Given that each pipe canhave its own associated set of audio controls, this means that apractitioner can assign a sample to a pipe that has a desired set ofaudio properties for the subject audio sample. As another example, thetrigger data 500 can include a pipe number that will be assigned to atriggered audio sample. In such a case, another mapping data structurecould be employed that maps pipes to trigger parameters to govern whichpipes get selected in response to which triggers. Similarly, a programroutine could be designed to increment a pipe number for each newtrigger in a loop of pipe numbers. As to voices, triggered samples canbe assigned to available voices 520 on a first come first serve basis ifdesired by a practitioner. But, it should be understood that triggeredsamples could be assigned to voices under an alternative managementcontrol to achieve certain results desired by a practitioner. A voicenumber to use could also be included in the trigger data.

While the invention has been described above in relation to its exampleembodiments, various modifications may be made thereto that still fallwithin the invention's scope. Such modifications to the invention willbe recognizable upon review of the teachings herein.

What is claimed is:
 1. An audio sample playback apparatus comprising: amemory configured to store (1) a plurality of audio samples, and (2) amapping data structure for the audio samples, the mapping data structureconfigured to associate the audio samples with at least one triggerparameter; and a processor configured to (1) receive trigger inputs, and(2) for each of a plurality of the received trigger inputs, (i)determine at least one trigger parameter from the received triggerinput, (ii) access the mapping data structure to identify a triggeredaudio sample associated with the determined at least one triggerparameter, (iii) retrieve the identified triggered audio sample from thememory, and (iv) generate an audio frame based on the retrievedtriggered audio sample.
 2. The apparatus of claim 1 wherein the mappingdata structure comprises a multi-dimensional array that associates theaudio samples with a plurality of trigger parameters; and wherein theprocessor is further configured to (1) determine a plurality of triggerparameters from the received trigger inputs, and (2) access the mappingdata structure to identify the triggered audio samples associated withthe determined trigger parameters.
 3. The apparatus of claim 2 whereinthe trigger parameters of the multi-dimensional array include a noteidentifier and/or a trigger velocity.
 4. The apparatus of claim 2wherein the multi-dimensional array further comprises a variancedimension for varying audio properties of an audio sample such thatmultiple triggers of the same audio sample for the same triggerparameters will produce sound with different audio properties.
 5. Theapparatus of claim 4 wherein the processor is further configured to loopthrough values of the variance dimension when the same audio sample isrepeatedly triggered.
 6. The apparatus of claim 1 wherein the mappingdata structure also associates a plurality of audio control settingswith each audio sample, and wherein the processor is further configuredto apply the audio control settings associated with a triggered audiosample to audio frame generation for that triggered audio sample.
 7. Theapparatus of claim 1 wherein the mapping data structure associates theaudio samples with the at least one trigger parameter via a plurality ofaudio sample identifiers.
 8. The apparatus of claim 7 wherein the audiosample identifiers comprise memory addresses for the audio samples inthe memory.
 9. The apparatus of claim 1 wherein the processor is furtherconfigured to (1) maintain a plurality of pipes of audio samples, (2)assign each of a plurality of the triggered audio samples to a pipeselected from among the pipes, (3) generate the audio frames fromtriggered audio samples in the pipes.
 10. The apparatus of claim 9wherein each pipe is associated with audio control settings for thepipe, and wherein the processor is further configured to apply the audiocontrol settings associated with a pipe to audio frame generation for atriggered audio sample within that pipe.
 11. The apparatus of claim 9wherein the processor is further configured to (1) maintain a pluralityof voices, (2) assign triggered audio samples to voices that areavailable, (3) link a plurality of voices with assigned triggered audiosamples to form at least one of the pipes.
 12. The apparatus of claim 11wherein the processor is further configured to populate the voices withdata about the triggered audio samples.
 13. The apparatus of claim 12wherein the populated data comprises identifiers for the triggered audiosamples and audio control settings for the triggered audio samples. 14.The apparatus of claim 1 wherein the processor is configured to executea plurality of threads concurrently to control audio sample playback inresponse to the received trigger inputs.
 15. The apparatus of claim 14wherein the threads comprise: a main thread; a mixer thread; a diskthread; and a jack process thread; wherein the main thread communicateswith the mixer thread via a dispatch ring buffer; wherein the mixerthread communicates with the disk thread via a disk ring buffer; andwherein the mixer thread communicates with the jack process thread via ajack ring buffer.
 16. The apparatus of claim 14 wherein the threadsinclude a thread configured to (1) receive trigger data, (2) determinewhich of the audio samples have been triggered based on the mapping datastructure as applied to the received trigger data, (3) populate voiceswith data about the triggered audio samples, and (4) dispatch thepopulated voices to a buffer.
 17. The apparatus of claim 16 wherein thethreads include another thread configured to (1) read populated voicesfrom the buffer, (2) coordinate a retrieval of the triggered audiosamples from the memory based on the populated voices, (3) mix theretrieved triggered audio samples with other active audio, and (4) writethe mixed audio to a second buffer.
 18. The apparatus of claim 17wherein the threads include yet another thread configured to (1) readmixed audio from the second buffer, and (2) create and deliver aplurality of audio frames to a sound card based on the read mixed audio.19. The apparatus of claim 17 wherein the memory comprises a firstmemory configured to store a plurality of heads for the audio samplesand a second memory configured to store a plurality of tails for theaudio samples; and wherein the another thread is configured to (1)access the first memory based on data within the read populated voicesto retrieve the heads for the triggered audio samples, and (2) writedata from the read populated voices to a third buffer to initiateretrieval of the tails for the triggered audio samples from the secondmemory.
 20. The apparatus of claim 19 wherein the threads include yetanother thread configured to (1) read data from the third buffer, (2)retrieve tails from the second memory based on the data read from thethird buffer, and (3) write the retrieved tails to the third buffer fordelivery to the another thread.
 21. The apparatus of claim 1 wherein theaudio samples comprise uncompressed audio files.
 22. The apparatus ofclaim 1 wherein the audio samples comprise a plurality of libraries ofaudio samples for a plurality of musical instruments, and wherein theprocessor is further configured to select a library of audio samples foroperation in response to user input.
 23. An audio sample playbackapparatus comprising: a first memory configured to store a plurality ofheads for a plurality of audio samples; a second memory configured tostore a plurality of tails for a plurality of the audio samples; and aprocessor configured to, in response to an audio sample being triggered,retrieve the head for the triggered audio sample from the first memoryand begin playback of the retrieved head prior to retrieval and playbackof the tail for the triggered audio sample from the second memory. 24.An audio sample playback apparatus comprising: a memory configured tostore a plurality of audio samples; and a processor configured to (1)retrieve audio samples from memory in response to triggers, (2) assigntriggered audio samples to a plurality of pipes, and (3) generate audioframes from the pipes based on the retrieved audio samples, wherein eachpipe has independently adjustable control settings for audio propertiesto be applied to audio samples within the pipes.